﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Qianli.DirSir.Model;
using Qianli.DirSir.Common;
using System.Data.SqlClient;
using System.Data;
namespace Qianli.DirSir.DAL
{
   public class StoreInfoDAL
    {
        SQLHelper helper = new SQLHelper();
        /// <summary>
        /// 显示店铺信息
        /// </summary>
        /// <returns></returns>
        public List<StoreInfo> ShowStoreInfo()
        {
            string sql = "select StoreID,StoreName from StoreInfo";

            DataTable table = helper.ExecDataTable(sql);
            List<StoreInfo> list = new List<StoreInfo>();
            foreach (DataRow item in table.Rows)
            {
                StoreInfo c = new StoreInfo();
                c.StoreID = Convert.ToInt32(item["StoreID"]);
                c.StoreName = item["StoreName"].ToString();
                list.Add(c);
            }
            return list;

        }
    }
}
